package com.visec.hdy.sync.util;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.nio.Buffer;

import org.apache.commons.net.ftp.FTPClient;

public class Test {
	public static void main(String[] args) throws Exception {
		FTPClient ftp=new FTPClient();
		ftp.connect("192.168.0.152", 21);
		ftp.login("admin", "123456");
		boolean retrieveFile = ftp.retrieveFile(new String("28所网络对接.docx".getBytes("utf-8"),"iso-8859-1"), new FileOutputStream("f:/sb.docx"));
//		InputStream r = ftp.retrieveFileStream(new String("28所网络对接.docx".getBytes("utf-8"),"iso-8859-1"));
//		FileOutputStream fos=new FileOutputStream("/root/sb.docx");
//		byte[] b=new byte[2048];
//		int a=0;
//		while((a=r.read(b))>0){
//			fos.write(b,0,a);
//		}
		
	}
}
